// const domitoryThemeColor = localStorage.getItem('domitoryThemeColor');
const state = {
  name: 'admin',
  Token: '',
  STATE_USER: {},
  primaryColor: '#D6AA55',
  // primaryColor: domitoryThemeColor,
  ruleRouter: [],
  ruleStatus: -1,
  accessControl: 0,
  accessControlTwo: 0,
  doorRule: 0,
  isShowModal: false, // 点击面包屑判断是否显示弹窗
  isSignList: false // 是否刷新签到名称列表
};

const actions = {};

const mutations = {
  setState(state, data) {
    state.STATE_USER = data;
  },
  // 设置Token
  setTokens(state, data) {
    state.Token = data;
  },
  // 设置主题色
  setPrimaryColor(state, data) {
    state.primaryColor = data;
  },
  // 移除Token
  removeToken(state) {
    state.Token = '';
  },
  // 修改主题色
  changeThemeColor(state, val) {
    state.themeColor = val;
  },
  // 设置规则路由信息
  setRuleRouter(state, val) {
    state.ruleRouter = val;
  },
  // 设置规则路由状态
  setRuleStatus(state, val) {
    state.ruleStatus = val;
  },
  setAccessControl(state, val) {
    state.accessControl = val;
  },
  setAccessControlTwo(state, val) {
    state.accessControlTwo = val;
  },
  setDoorRule(state, val) {
    console.log('aaa---aaa', val);
    state.doorRule = val;
  },
  updateIsShowModal(state, val) {
    state.isShowModal = val;
  },
  updateSignList(state, val) {
    state.isSignList = val;
  }
};

export default {
  namespaced: true,
  state,
  actions,
  mutations
};
